package com.zp.self.module.level_5_设计模式.创建型模式.Ⅱ_工厂方法.枚举工厂;

import org.junit.Test;

/**
 * @author ：by Zeng Peng
 * @date ：Created 2022/6/25 9:53
 * @description ：咖啡店业务类
 */
public class CoffeeStore {

    public Coffee orderCoffee(String type){
        return CoffeeEnumFactory.match(type);
    }

    @Test
    public void orderCoffeeTest(){
        CoffeeStore store = new CoffeeStore();
        Coffee coffee_01 = store.orderCoffee("AmericanCoffee");
        System.out.println(coffee_01.getName());

        System.out.println("----------分割线---------------");

        Coffee coffee_02 = store.orderCoffee("LatteCoffee");
        System.out.println(coffee_02.getName());

        System.out.println("----------分割线---------------");

        Coffee coffee_03 = store.orderCoffee("六神花露水");
        System.out.println(coffee_03.getName());
    }
}
